package com.project.server.service.traffic.impl;

import com.project.common.core.domain.BaseServer;
import com.project.server.domain.traffic.TTrafficViolation;
import com.project.server.mapper.traffic.TTrafficViolationMapper;
import com.project.server.service.traffic.ITTrafficViolationService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 交通违规信息Service业务层处理
 *
 * @author project
 * @date 2021-07-02
 */
@Service
public class TTrafficViolationServiceImpl extends BaseServer implements ITTrafficViolationService {

    private static final Logger log = LoggerFactory.getLogger(TTrafficViolationServiceImpl.class);

    @Resource
    private TTrafficViolationMapper tTrafficViolationMapper;

    /**
     * 查询交通违规信息
     *
     * @param violationId 交通违规信息ID
     * @return 交通违规信息
     */
    @Override
    public TTrafficViolation selectTTrafficViolationById(Long violationId) {
        return tTrafficViolationMapper.selectTTrafficViolationById(violationId);
    }

    /**
     * 查询交通违规信息列表
     *
     * @param tTrafficViolation 交通违规信息
     * @return 交通违规信息
     */
    @Override
    public List<TTrafficViolation> selectTTrafficViolationList(TTrafficViolation tTrafficViolation) {
        return tTrafficViolationMapper.selectTTrafficViolationList(tTrafficViolation);
    }

    /**
     * 新增交通违规信息
     *
     * @param tTrafficViolation 交通违规信息
     * @return 结果
     */
    @Override
    public int insertTTrafficViolation(TTrafficViolation tTrafficViolation) {
        super.insert(tTrafficViolation);
        return tTrafficViolationMapper.insertTTrafficViolation(tTrafficViolation);
    }

    /**
     * 修改交通违规信息
     *
     * @param tTrafficViolation 交通违规信息
     * @return 结果
     */
    @Override
    public int updateTTrafficViolation(TTrafficViolation tTrafficViolation) {
        super.update(tTrafficViolation);
        return tTrafficViolationMapper.updateTTrafficViolation(tTrafficViolation);
    }

    /**
     * 批量删除交通违规信息
     *
     * @param violationIds 需要删除的交通违规信息ID
     * @return 结果
     */
    @Override
    public int deleteTTrafficViolationByIds(Long[] violationIds) {
        return tTrafficViolationMapper.deleteTTrafficViolationByIds(violationIds);
    }

    /**
     * 删除交通违规信息信息
     *
     * @param violationId 交通违规信息ID
     * @return 结果
     */
    @Override
    public int deleteTTrafficViolationById(Long violationId) {
        return tTrafficViolationMapper.deleteTTrafficViolationById(violationId);
    }
}
